"""Add creator field to petition_record table

Revision ID: 31434f7add_creator_field
Revises: e878809dde0a
Create Date: 2025-09-12 10:30:00.000000

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '31434f7add_creator_field'
down_revision: Union[str, Sequence[str], None] = 'e878809dde0a'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    """Upgrade schema."""
    # 添加creator字段到petition_record表
    op.add_column('petition_record', sa.Column('creator', sa.String(length=20), nullable=True, comment='创建者'))


def downgrade() -> None:
    """Downgrade schema."""
    # 删除creator字段
    op.drop_column('petition_record', 'creator')